package com.company.jd;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Test2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()){
            int m = sc.nextInt();
            int n = sc.nextInt();
            List<Integer> res = getFlower(m,n);
            if(res.size() == 0){
                System.out.println("no");
            }else if(res.size() == 1){
                System.out.println(res.get(0));
            }else{
                System.out.print(res.get(0));
                for (int i = 1; i < res.size(); i++) {
                    System.out.print(" ");
                    System.out.print(res.get(i));
                }
            }

        }
    }

    private static List<Integer> getFlower(int m,int n){
        List<Integer> res = new ArrayList<>();
        for(int i = m;i <= n;i++){
            int temp = i;
            int t = 0;
            while (temp != 0){
                t += Math.pow(temp % 10,3);
                temp /= 10;
            }
            if(i == t){
                res.add(i);
            }
        }
        return res;
    }

}
